<%@page isELIgnored="false" import="java.net.*" %>
<%@taglib prefix="tiles" uri="struts-tiles" %>
<%@taglib prefix="html" uri="struts-html" %>
<%@taglib prefix="bean" uri="struts-bean" %>
<%@taglib prefix="c" uri="jstl" %>
<%@taglib prefix="mcfn" uri="mcfn" %>
<%@taglib prefix="fn" uri="jstl-fn" %>
<c:set var="TareasLength" value="${fn:length(Tareas)}" />
				<div id="bodyContent">
						<h1>Tasks</h1>
						<html:form action="/TareasOperation" method="post" styleId="TareasForm">
						<html:hidden property="cveFlujo" styleId="cveFlujo" value="${TareasOperationForm.cveFlujo}"  />
						<html:hidden property="cveTarea" styleId="cveTarea"  />
						<html:hidden property="operation" styleId="operation" />
						<html:hidden property="page" value="1" />
						</html:form>
						<div onclick="location.href='${URLBase}Flujos.do';" style="display: inline; color: blue; font-size: 12px;" onmouseover="this.style.textDecoration='underline';this.style.cursor='pointer';" onmouseout="this.style.textDecoration='none';this.style.cursor='default';" >Flows</div><div style="display: inline; color: black; font-size: 12px;" > > </div>
						<div style="display: inline; color: black; font-size: 12px;"  >Flow tasks (${TareasOperationForm.nombreFlujo})</div>
						<br/>
						<br/>
						<table style="border: 0px solid red ; width: 100%;" border="0" >
							<tr>
								<td colspan="3" align="right">
									<html:image src="images/btnAdd.gif" onclick="document.getElementById('operation').value=1;document.getElementById('TareasForm').submit( );" />
								</td>
							</tr>
						</table>
						<table class="tabDatos">
<c:choose>
<c:when test="${TareasLength gt 0}">
							<thead>
								<tr>
									<th width="15%">Name</th>
									<th width="40%">Description</th>
									<th width="20%">Flow</th>
									<th width="10%">First task</th>
									<th width="15%">&nbsp;</th>
								</tr>
							</thead>
<c:forEach items="${Tareas}" var="tarea" varStatus="tareaStatus">
							<tr>
								<td>${mcfn:getShortString(tarea.nombre,30)}</td>
								<td>${mcfn:getShortString(tarea.descripcion,150)}</td>
								<td>${mcfn:getShortString(tarea.tblFlujo.nombre,30)}</td>
								<td>
<c:choose>
<c:when test="${tarea.firstWork eq 1}">									First Task</c:when>
<c:otherwise >									<bean:message key="com.mastercard.assets.web.modules.tareas.index.labels.head.PrimeraTarea.0"/></c:otherwise>
</c:choose>
								</td>
								<td>
									<html:image src="images/btnEliminar.gif" onclick="document.getElementById('operation').value=2;document.getElementById('cveTarea').value=${tarea.cveTarea};document.getElementById('TareasForm').submit( );" />
									&nbsp; 
									<html:image style="display:inline;" src="images/btnEdit.gif" onclick="document.getElementById('operation').value=3;document.getElementById('cveTarea').value=${tarea.cveTarea};document.getElementById('TareasForm').submit( );" />
									&nbsp; 
									<!-- 
									<html:image style="display:inline;" src="images/btnEdit.gif" onclick="document.getElementById('operation').value=3;document.getElementById('cveTarea').value=${tarea.cveTarea};document.getElementById('TareasForm').submit( );" />
									 -->
									<br/>
									[<div style="display:inline;" onmouseover="this.style.cursor='pointer';this.style.textDecoration='underline';" onmouseout="this.style.cursor='default';this.style.textDecoration='none';" onclick="document.getElementById('operation').value=4;document.getElementById('cveTarea').value=${tarea.cveTarea};document.getElementById('TareasForm').submit( );">Exits</div>]
									<br/>
									[<div style="display:inline;" onmouseover="this.style.cursor='pointer';this.style.textDecoration='underline';" onmouseout="this.style.cursor='default';this.style.textDecoration='none';" onclick="document.getElementById('operation').value=9;document.getElementById('cveTarea').value=${tarea.cveTarea};document.getElementById('TareasForm').submit( );">Alarms</div>]
									<br/>
									[<div style="display:inline;" onmouseover="this.style.cursor='pointer';this.style.textDecoration='underline';" onmouseout="this.style.cursor='default';this.style.textDecoration='none';" onclick="document.getElementById('operation').value=15;document.getElementById('cveTarea').value=${tarea.cveTarea};document.getElementById('TareasForm').submit( );">First task</div>]
								</td>
							</tr>
</c:forEach>
</c:when>
<c:otherwise>
							<tr>
								<td colspan="3">
									No tasks to list
								</td>
							</tr>
</c:otherwise>
</c:choose>
						</table>
						



					</div>
					<div id="footContent"></div>
